import { createBrowserRouter, Navigate } from 'react-router-dom';
import Overview from '../pages/overview'; // 运营概览
import User from '../pages/user';
import Error from '../pages/error';

const router = createBrowserRouter([
    {
        path: '/',
        name: 'Home',
        element:<Navigate to="/overview" replace={true}/>, // 重定向的写法
        meta: {
            title: '首页',
        },
    },
    {
        path: '/overview',
        name: 'Overview',
        element:<Overview /> ,
        meta: {
            title: '运营概览',
        },
    },
    {
        path: '/user',
        name: 'User',
        element: <User />,
        meta: {
            title: '用户',
        },
    },
    {
        path: '*',
        name: 'Error',
        element: <Error />,
        meta: {
            title: '错误!',
        },
    },
]);


export default router;
